package com.kcyu.egoodsmapbackend.controller;

import cn.dev33.satoken.util.SaResult;
import com.kcyu.egoodsmapbackend.entity.Goods;
import com.kcyu.egoodsmapbackend.entity.WebPage;
import com.kcyu.egoodsmapbackend.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kcyu
 * @since 2025-03-03
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private IGoodsService goodsService;

    @PostMapping("page")
    public SaResult page(@RequestBody WebPage<Goods> page) {
        WebPage<Goods> page1 = goodsService.page(page);
        return SaResult.data(page1);
    }

}
